using System;
using System.Drawing;

namespace CCAI.Office.PowerPoint.TimedText.Captions
{
    /// <summary>
    /// Represents an on-screen region where captions will be displayed.
    /// </summary>
    public class CaptionRegion : TimedTextElement
    {
        public CaptionRegion()
        {
            ApplyDefaultStyle();
        }

        private void ApplyDefaultStyle()
        {
            CaptionElementType = TimedTextElementType.Region;
            Begin = TimeSpan.MinValue;
            End = TimeSpan.MaxValue;
            Style.BackgroundColor = Color.Black;
            Style.Origin = new Origin
                               {
                                   Left = new Length
                                              {
                                                  Value = .1f,
                                                  Unit = LengthUnit.Percent
                                              },
                                   Top = new Length
                                             {
                                                 Value = .8f,
                                                 Unit = LengthUnit.Percent
                                             }
                               };

            Style.Extent = new Extent
                               {
                                   Height = new Length
                                                {
                                                    Value = .1f,
                                                    Unit = LengthUnit.Percent
                                                },
                                   Width = new Length
                                               {
                                                   Value = .8f,
                                                   Unit = LengthUnit.Percent
                                               }
                               };
        }
    }
}